/*
 * ROSIF.h
 *
 *  Created on: Nov 17, 2012
 *      Author: bouchier
 */
/*! \file ROSIF.h
 * \brief Header file declaring the ROSIF (ROS Interface) class
 */
#ifndef ROSIF_H_
#define ROSIF_H_
class ControlledMotor;

/*!
 * \class ROSIF
 * This class provides an interface to ROS. First, initRos() should be called, which sets up the connection to the
 * rosserial_python proxy if it finds the file RosSrvrIp. (RosSrvrIp is a text file in /opt/usr/bin which can be
 * deleted to disable ROS connectivity, or edited to contain the IP address of the server running the
 * rosserial_python proxy.)
 *
 * Next, poll() should be called as often as desired. It checks to see whether there are messages to or
 * from ROS, and in the case of a Twist message from ROS, pulls the requested linear/angular speed
 * out of the message.
 */
class ROSIF {
public:
	ROSIF();
	virtual ~ROSIF();
	bool initRos();
	void poll();
	void publishRobotTelemetry();
	void setTestRobotMotionData(float f);
	void publishDriveMotorTelemetry();
	void publishSteerMotorTelemetry();
	void getRosLinearAngular(float& linearRef, float& angularRef);

    bool telemetryTestFlag;				// set true to fill telemetry arrays with test data
    bool rosEnabled;

private:
	char rosSrvrIp[20];
	float rosLinear;
	float rosAngular;
};

#endif /* ROSIF_H_ */
